CSS2 introduces a new @rule and a number of properties to help create style sheets that are designed for printing pages. We'll learn about printing and CSS in this chapter, and how Style Master Pro is designed to help you work with it.
We can't go into great detail in the manual about printing in CSS2, but we do cover this topic in detail in the CSS Guide. However, we will have a short introduction to the subject.
In a nutshell, printing in CSS2 works like this. The @page rule has been introduced to let you define the size, orientation, margin and printers marks of the paper page onto which a web page will be printed.
There are also a number of properties that can be applied to any element that can control how pages break, and what happens with widow and orphan elements.
For details on each of these, see our Guide.
You create and edit an @page rule with @page editor.
To create an @page Rule
1. choose
from the menu2. choose
from the pop-up menu in the dialog.The @page Rule Editor opens.
An @page rule can apply to all pages, or left hand side or right hand side pages.
To choose which pages the @page rule applies to
1. choose all, left or right in the pop-up menu at the top of the window.
An @page rule can be named. That way, using the page
property, an element can be printed using a named @page rule.
To name an @page rule
1. enter the name for the rule in the field labeled "Name"
@page rules have a specific set of properties which may be applied to them alone. These specify the size, orientation, printers marks and margins for the paper page on which the web page is printed. You edit these using the Printing Editor.
To open the printing editor
1. choose
from the Properties menu2. the printing editor opens
Use the various fields of the printing editor to edit the size and other properties of the @page rule. Note that you will only be able to edit these properties if an @page rule has been selected in the list of statements of the style sheet.
An important aspect of printing is controlling how and where pages will break (that is where a new page will begin) when a web page is being printed. With CSS2 you can control whether or not a new page should be begun before, in the middle of, or after an element. For instance, you can specify that a new page should be begun before any heading of level 1, or should be avoided during a paragraph of class "important".
You edit these properties using the Page Break Editor
To open the page break editor
1. choose
from the Properties menu2. the page break editor opens
In this chapter, we learnt about CSS2 support for printing, and how Style Master helps you work with it. Next we will take a look at how Style Master Pro helps you work with a very advanced aspect of CSS2, the @font-face rule.